#include <iomacros.h>
#include <msp430f2617.h>
#include <stdint.h>

#include "drivers/dbg_uart.h"
#include "common.h"
#include "error.h"


/**
 * If we come here, it is over. Cycle the red
 * led, print the err message periodically on
 * the serial line.
 * Mainly for debugging.
 */
void error(char * err) {
	__disable_interrupt();

	while (1) {
		P5OUT ^= BV(4);
		uart_write(err);

		__delay_cycles(0.5*SYSFREQ);
	}
}
